/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Practica4.Practica;

import Practica4.sort.WorstCases;
import java.util.Random;

/**
 *
 * @author miguel
 */
public class MyWorstCases implements WorstCases {

    @Override
    public int[] forLocalInsertionSort(int num_elements) {
        Random r = new Random();
        int[] array;
        MyIntegerArray mia = new MyIntegerArray();
        array = mia.zigZag(r.nextInt(100), num_elements);
        return array;
    }

    @Override
    public int[] forQuickSort(int num_elements) {
        return this.orderedSequence(num_elements);
    }

    @Override
    public int[] reverseSequence(int elements) {
        int[] array = orderedSequence(elements);
        MyIntegerArray mia = new MyIntegerArray();
        mia.inverse(array);
        return array;
    }

    @Override
    public int[] orderedSequence(int elements) {
        int[] array = new int[elements];
        for(int i=0;i<elements;i++){
            array[i] = i;
        }
        return array;
    }
}
